﻿using System;

namespace _05_Ex02
{
    enum Orientation : byte
    {
        north = 1,
        south = 2,
        east = 3,
        west = 4
    }
    struct Route
    {
        public Orientation direction;
        public double distance;
    }
    class Program
    {
        static void Main(string[] args)
        {
            Route route;
            int myDirection = -1;
            double myDistance;
            Console.WriteLine("1) North\n2) South\n3) East\n4) West");
            do
            {
                Console.WriteLine("Select a direction:");
                myDirection = Convert.ToInt32(Console.ReadLine());
            } while ((myDirection < 1) || (myDirection > 4));
            Console.WriteLine("Input a distance:");
            myDistance = Convert.ToDouble(Console.ReadLine());
            route.direction = (Orientation)myDirection;
            route.distance = myDistance;
            Console.WriteLine($"route specifies a direction of {route.direction} " +
                $"and a distance of {route.distance}");

            Console.ReadKey();
        }
    }
}
